﻿using System;
using wojilu.ORM;

namespace wojilu.Apps.Qycms.Domain
{
    [Table("ybb_calling")]
    [Serializable]
    public class Calling : ObjectBase<Calling>
    {
        [NotNull(""), Default(50), Column(Length = 11)]
        public Int32 pid { get; set; }

        [NotNull(""), Column(Length = 50)]
        public String lng { get; set; }

        [TinyInt, Column(Length = 1), NotNull(""), Default(1)]
        public Int32 type { get; set; }

        [TinyInt, Column(Length = 1), NotNull("")]
        public Int32 style { get; set; }

        [NotNull(""), Column(Length = 200)]
        public String name { get; set; }

        [LongText]
        public String code { get; set; }

        [NotNull("")]
        public DateTime addtime { get; set; }

        [TinyInt, Column(Length = 1), NotNull(""), Default(1)]
        public Int32 isclass { get; set; }

        [NotSave]
        public String typename
        {
            get
            {
                var ct = cdb.findById<CallType>(type);
                return wojilu.lang.get(ct.Name);
            }
        }

    }
}
